package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.Accumulate;
import cn.wolfcode.trip.base.mapper.AccumulateMapper;
import cn.wolfcode.trip.base.service.IAccumulateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AccumulateServiceImpl implements IAccumulateService {

    @Autowired
    private AccumulateMapper accumulateMapper;

    @Override
    public List<Accumulate> listTotal(Long userId) {
        return null;
    }

    @Override
    public void updateBalance(Long userId, Double balance) {
        accumulateMapper.updateBalance(userId,balance);
    }

    @Override
    public Accumulate selectOrUser(Long id) {
        return accumulateMapper.selectOrUser(id);
    }

    @Override
    public void saveUser(Accumulate accumulate) {
        accumulateMapper.insert(accumulate);
    }

    @Override
    public void updateBalanceRecharge(Long id, Double balance) {
        accumulateMapper.updateBalanceRecharge(id,balance);
    }

    @Override
    public Accumulate selectDeposit(Long id) {
        return accumulateMapper.selectByPrimaryKey(id);
    }

    @Override
    public Accumulate selectRecharge(Long id) {
        return accumulateMapper.selectByPrimaryKey(id);
    }
}
